#include <iostream>
#include <cstring>
using namespace std;

const int N = 100010;
int h[N], e[N], ne[N], idx; //邻接表
int q[N], l = 0, r = -1;    //队列
int d[N];                   //用来存储入度
int n, m, x, y;             //获取输入

void add(int x, int y)
{
    d[y]++;
    e[idx] = y;
    ne[idx] = h[x];
    h[x] = idx++;
    return;
}

bool topsort()
{
    for (int i = 1; i <= n; ++i) //首先找到所有的入度为0的点
        if (!d[i])
            q[++r] = i;
    while (r >= l) //只要队列里面还有元素，就继续循环
    {
        int t = q[l++];
        for (int i = h[t]; i != -1; i = ne[i])
        {
            int j = e[i];
            if (--d[j] == 0) //此题不需要记录是否遍历过，因为遍历过的点都是没有入度了
                q[++r] = j;
        }
    }
    return r == n - 1; //既所有的点都进过栈
}

int main()
{
    memset(h, -1, sizeof h); //初始表头全部为空
    cin >> n >> m;
    while (m--) //获取输入
    {
        cin >> x >> y;
        add(x, y);
    }
    if (!topsort()) //如果满足拓扑图，则直接输出
        cout << -1;
    else
        for (int i = 0; i < n; ++i)
            cout << q[i] << " ";
    return 0;
}